package pl.makimo.fuzzy.linguistics;

import java.util.ArrayList;
import java.util.List;

import pl.makimo.fuzzy.norms.Norm;
import pl.makimo.fuzzy.sets.CompoundFuzzySet;
import pl.makimo.fuzzy.sets.CompoundFuzzySetFactory;

public class CompoundQualifier<T> extends Qualifier<T> {
	public Qualifier<T> qualifier1;
	public Qualifier<T> qualifier2;
	
	public Norm norm;
	public Norm type2norm;
	
	public List<Qualifier<T>> getSingleQualifiers() {
		List<Qualifier<T>> qualifiers = new ArrayList<Qualifier<T>>();
		qualifiers.addAll(qualifier1.getSingleQualifiers());
		qualifiers.addAll(qualifier1.getSingleQualifiers());
		return qualifiers;
	}	

	public CompoundQualifier(Qualifier<T> qualifier1, Qualifier<T> qualifier2, Norm norm, Norm type2norm) {
		this.qualifier1 = qualifier1;
		this.qualifier2 = qualifier2;
		
		this.norm = norm;
		this.type2norm = type2norm;
		
		this.set = CompoundFuzzySetFactory.make(qualifier1.set, qualifier2.set, norm, type2norm);
	}

	@Override
	public String toString() {
		return qualifier1.toString() + " " + this.norm.toString() + " " + qualifier2.toString();
	}
}
